package com.gitee.dao;

import com.gitee.entity.Record;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface recordDao {
    //插入资金充值的交易记录
    @Insert("insert into recordmoney(userid,moneyType,money) values(userid=#{userid},moneyType=#{moneyType},money=#{money})")
    public int insert(String userid,int moneyType,double money);

    //根据资金记录id去查询某一条资金记录
    @Select("select * from recordmoney where recordid = #{recordid}")
    public Record selectByid(int recordid);

    //根据资金记录id去删除某一条资金记录
    @Delete("delete from recordmoney where recordid = #{recordid}")
    public int delete(int recordid);

    @Select("select * from recordmoney where userid = #{userid}")
    public List<Record> selectAll(String userid);
}
